<template>
	<div class="radio_group">
		<div @click='switchHand(index)' :class="[typer ?'item2':'item', value == radioList[index].content &&  'active']"
			v-for="(item,index) in radioList" :key="index">{{item.content}}</div>
	</div>
</template>

<script>
	export default {
		model: {
			prop: 'value',
			event: 'input'
		},
		props: {
			value: {
				type: String
			},
			arr: {
				type: Array,
				default: []
			},
			typer:{
				type:Boolean,
				default:false
			}
		},
		created() {
			this.radioList = this.arr
		},
		data() {
			return {
				radioList: []
			}
		},
		methods: {
			switchHand(index) {
				this.$emit('input', this.radioList[index].content)
				this.$emit('check')
			}
		}
	}
</script>

<style scoped lang="less">
	.radio_group {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;

		.item {
			flex-shrink: 0;
			width: 290rpx;
			height: 74rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			color:#000;
			font-weight: bold;
			border-radius: 40rpx;
			box-sizing: border-box;
			background-color: #fff;
			margin-bottom:36rpx;
			border: 1px solid #D4E7F2;

			&.active {
				background-color: #4E6FD9;
				color:#fff;
			}
		}
		.item2{
			flex-shrink: 0;
			width: 100%;
			height: 74rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			color:#000;
			font-weight: bold;
			border-radius: 40rpx;
			box-sizing: border-box;
			background-color: #fff;
			margin-bottom:36rpx;
			border: 1px solid #D4E7F2;
			&.active {
				background-color: #4E6FD9;
				color:#fff;
			}
		}

	}
</style>